Optimal. Leaf size=113 \[ -\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac {(A b-a B) (a+b x) \log (x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {(A b-a B) (a+b x) \log (a+b x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {783, 660, 36,
29, 31} \begin {gather*} -\frac {\log (x) (a+b x) (A b-a B)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {(a+b x) (A b-a B) \log (a+b x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 660
Rule 783
Rubi steps
\begin {align*} \int \frac {A+B x}{x^2 \sqrt {a^2+2 a b x+b^2 x^2}} \, dx &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac {\left (2 A b^2-2 a b B\right ) \int \frac {1}{x \sqrt {a^2+2 a b x+b^2 x^2}} \, dx}{2 a b}\\ &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac {\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac {1}{x \left (a b+b^2 x\right )} \, dx}{2 a b \sqrt {a^2+2 a b x+b^2 x^2}}\\ &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}+\frac {\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac {1}{a b+b^2 x} \, dx}{2 a^2 \sqrt {a^2+2 a b x+b^2 x^2}}-\frac {\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac {1}{x} \, dx}{2 a^2 b^2 \sqrt {a^2+2 a b x+b^2 x^2}}\\ &=-\frac {A \sqrt {a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac {(A b-a B) (a+b x) \log (x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {(A b-a B) (a+b x) \log (a+b x)}{a^2 \sqrt {a^2+2 a b x+b^2 x^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 57, normalized size = 0.50 \begin {gather*} \frac {(a+b x) (-a A+(-A b x+a B x) \log (x)+(A b-a B) x \log (a+b x))}{a^2 x \sqrt {(a+b x)^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.57, size = 61, normalized size = 0.54
method | result | size |
default | \(\frac {\left (b x +a \right ) \left (A \ln \left (b x +a \right ) b x -A \ln \left (x \right ) b x -B \ln \left (b x +a \right ) a x +B \ln \left (x \right ) a x -A a \right )}{\sqrt {\left (b x +a \right )^{2}}\, a^{2} x}\) | \(61\) |
risch | \(-\frac {\sqrt {\left (b x +a \right )^{2}}\, A}{\left (b x +a \right ) a x}-\frac {\sqrt {\left (b x +a \right )^{2}}\, \left (A b -B a \right ) \ln \left (x \right )}{\left (b x +a \right ) a^{2}}+\frac {\sqrt {\left (b x +a \right )^{2}}\, \left (A b -B a \right ) \ln \left (-b x -a \right )}{\left (b x +a \right ) a^{2}}\) | \(95\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 106, normalized size = 0.94 \begin {gather*} -\frac {\left (-1\right )^{2 \, a b x + 2 \, a^{2}} B \log \left (\frac {2 \, a b x}{{\left | x \right |}} + \frac {2 \, a^{2}}{{\left | x \right |}}\right )}{a} + \frac {\left (-1\right )^{2 \, a b x + 2 \, a^{2}} A b \log \left (\frac {2 \, a b x}{{\left | x \right |}} + \frac {2 \, a^{2}}{{\left | x \right |}}\right )}{a^{2}} - \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} A}{a^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.01, size = 41, normalized size = 0.36 \begin {gather*} -\frac {{\left (B a - A b\right )} x \log \left (b x + a\right ) - {\left (B a - A b\right )} x \log \left (x\right ) + A a}{a^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.18, size = 95, normalized size = 0.84 \begin {gather*} - \frac {A}{a x} + \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a b + B a^{2} - a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} - \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a b + B a^{2} + a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.16, size = 81, normalized size = 0.72 \begin {gather*} \frac {{\left (B a \mathrm {sgn}\left (b x + a\right ) - A b \mathrm {sgn}\left (b x + a\right )\right )} \log \left ({\left | x \right |}\right )}{a^{2}} - \frac {A \mathrm {sgn}\left (b x + a\right )}{a x} - \frac {{\left (B a b \mathrm {sgn}\left (b x + a\right ) - A b^{2} \mathrm {sgn}\left (b x + a\right )\right )} \log \left ({\left | b x + a \right |}\right )}{a^{2} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.49, size = 117, normalized size = 1.04 \begin {gather*} \frac {A\,a\,b\,\mathrm {atanh}\left (\frac {a^2+b\,x\,a}{\sqrt {a^2}\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}\right )}{{\left (a^2\right )}^{3/2}}-\frac {A\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}{a^2\,x}-\frac {B\,\ln \left (a\,b+\frac {a^2}{x}+\frac {\sqrt {a^2}\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}{x}\right )}{\sqrt {a^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________